import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../components/Login.vue'
import Test from '../components/common/test.vue'
// 测试组件

Vue.use(VueRouter)

const routes = [
  { path: '/', redirect: '/test' },
  { path: '/login', name:'login',component: Login },
  { path: '/modify', component: () => import('../components/modify.vue') },
  // { path: '/editorbar', component: () => import('../views/fuwenben/EditorBar') },
  {
    path: '/test',
    name: 'test',
    component: Test,
    children: [
      // 首页
      // {
      //   path:'home',
      //   name:'home',
      //   component: () => import('../views/home/index.vue')
      // },
      // 个人中心
      {
        path:'personInfo',
        name:'personInfo',
        component: () => import('../views/personInfo/index.vue')
      },
      // 权限管理
      {
        path:'level',
        name:'level',
        component: () => import('../views/setLevel/index.vue')
      },
      // 员工管理
      {
        path:'staff',
        name:'staff',
        component: () => import('../views/courseManage/workRoom.vue')
      },
      // 项目管理
      {
        path:'project',
        name:'project',
        component: () => import('../views/project/index.vue')
      },
      // 薪资专员新增工资单
      {
        path:'payAdminAdd',
        name:'payAdminAdd',
        component: () => import('../views/payroll/addIndex.vue')
      },
      // 工资单管理(有权限的人查看系统内所有工资单)
      {
        path:'payAdminAudit',
        name:'payAdminAudit',
        component: () => import('../views/payroll/auditIndex.vue')
      },
      // 所有员工新增报销单
      {
        path:'myReimbursement',
        name:'myReimbursement',
        component: () => import('../views/reimbursement/myReimbursement/index.vue')
      },
      // 报销单管理(有权限的人查看系统内所有报销单)
      {
        path:'reimbursementManage',
        name:'reimbursementManage',
        component: () => import('../views/reimbursement/reimbursementManage/index.vue')
      },
      // 财务专员新增支付凭证
      {
        path:'addPayment',
        name:'addPayment',
        component: () => import('../views/payment/addPayment/index.vue')
      },
      //支付凭证管理(有权限的人查看系统内所有支付凭证)
      {
        path:'seePayment',
        name:'seePayment',
        component: () => import('../views/payment/seePayment/index.vue')
      },

      //薪资发放记录
      {
        path:'payrollRecord',
        name:'payrollRecord',
        component: () => import('../views/payrollRecord/index.vue')
      }
    ]
  },
  // 工资单详情
  {
    path:'/payAdminDetail/:id',
    name:'payAdminDetail',
    component: () => import('../views/payroll/model/payAdminDetail.vue'),
    meta: { hideSider: true}
  },
  // 报销单详情
  {
    path:'/reimbursementDetail/:id',
    name:'reimbursementDetail',
    component: () => import('../views/reimbursement/components/reimbursementDetail.vue'),
    meta: { hideSider: true}
  },
  // 支付凭证详情
  {
    path:'/paymentDetail/:id',
    name:'paymentDetail',
    component: () => import('../views/payment/components/paymentDetail.vue'),
    meta: { hideSider: true}
  },
]

const router = new VueRouter({
  routes
})

export default router
